#include "Gk.h"

#include "GkContext.h"
#include "GkContextInterface.h"

namespace gk
{
	void Context::BeginFrame()
	{
		m_internal.BeginFrame();
	}

	void Context::EndFrame()
	{
		m_internal.SetRenderBinding(NULL);
		m_internal.EndFrame();
	}

	void Context::SetRenderTarget(RenderTargetHandle hRenderTarget)
	{
		m_internal.SetRenderTarget(hRenderTarget);
	}

	void Context::ClearRenderTarget(ClearType::Enum clearType, float r, float g, float b, float a, float depth, cr::uint8_t stencil)
	{
		m_internal.ClearRenderTarget(clearType, r, g, b, a, depth, stencil);
	}

	void Context::SetRenderBinding(RenderBindingHandle hRenderBinding)
	{
		m_internal.SetRenderBinding(hRenderBinding);
	}

	void Context::DrawIndexedPrimitives(BufferHandle hIndexBuffer, PrimitiveType::Enum primitiveType, cr::size_t indexCount, cr::size_t startIndex, cr::size_t vertexCount, cr::size_t startVertex)
	{
		m_internal.DrawIndexedPrimitives(hIndexBuffer, primitiveType, indexCount, startIndex, vertexCount, startVertex);
	}

	void Context::DrawPrimitives(PrimitiveType::Enum primitiveType, cr::size_t startVertex, cr::size_t numVertices)
	{
		m_internal.DrawPrimitives(primitiveType, startVertex, numVertices);
	}

	void Context::BeginGpuProgram(GpuProgramHandle hGpuProgram)
	{
		m_internal.BeginGpuProgram(hGpuProgram);
	}

	void Context::EndGpuProgram()
	{
		m_internal.EndGpuProgram();
	}

	void Context::CommitConstantBuffer(ConstantBufferHandle hConstantBuffer)
	{
		m_internal.CommitConstantBuffer(hConstantBuffer);
	}

	void Context::CommitGpuProgram()
	{
		m_internal.CommitGpuProgram();
	}

	void Context::CommitStateBlock(StateBlockHandle hStateBlock)
	{
		m_internal.CommitStateBlock(hStateBlock);
	}
}